/*
 Navicat Premium Data Transfer

 Source Server         : 本地docker 密码123456
 Source Server Type    : MySQL
 Source Server Version : 50733
 Source Host           : localhost:3306
 Source Schema         : private_chat

 Target Server Type    : MySQL
 Target Server Version : 50733
 File Encoding         : 65001

 Date: 03/02/2022 14:27:31
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for chat_group
-- ----------------------------
DROP TABLE IF EXISTS `chat_group`;
CREATE TABLE `chat_group` (
  `id` varchar(32) NOT NULL,
  `name` varchar(255) DEFAULT NULL COMMENT '群名',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  `creator_id` varchar(255) DEFAULT NULL COMMENT '创建者id',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of chat_group
-- ----------------------------
BEGIN;
INSERT INTO `chat_group` VALUES ('0d51909a510b11ecaa4f0242ac110004', '群聊测试', NULL, '1', '2021-11-29 19:55:55');
COMMIT;

-- ----------------------------
-- Table structure for chat_group_member
-- ----------------------------
DROP TABLE IF EXISTS `chat_group_member`;
CREATE TABLE `chat_group_member` (
  `id` varchar(32) NOT NULL,
  `group_id` varchar(32) DEFAULT NULL COMMENT '群组id',
  `member_id` varchar(32) DEFAULT NULL COMMENT '群成员id',
  `is_admin` tinyint(2) DEFAULT NULL COMMENT '群成员是否为管理员',
  `created_time` datetime DEFAULT NULL COMMENT '加入该群的时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of chat_group_member
-- ----------------------------
BEGIN;
INSERT INTO `chat_group_member` VALUES ('c90dba57510b11ecaa4f0242ac110004', '0d51909a510b11ecaa4f0242ac110004', '1', 1, '2021-11-29 19:59:53');
COMMIT;

-- ----------------------------
-- Table structure for chat_lately
-- ----------------------------
DROP TABLE IF EXISTS `chat_lately`;
CREATE TABLE `chat_lately` (
  `id` varchar(32) NOT NULL,
  `owner_id` varchar(32) DEFAULT NULL COMMENT '该消息目录的主人',
  `target_id` varchar(32) DEFAULT NULL COMMENT '目标的id',
  `type` varchar(255) DEFAULT NULL COMMENT '当前item的类型 1：人聊天；2：群聊天',
  `message` varchar(255) DEFAULT NULL COMMENT '最新的消息，为了追求性能，把消息表中的消息内容同步过来',
  `no_read` int(8) DEFAULT NULL COMMENT '未阅读数量',
  `update_time` datetime DEFAULT NULL COMMENT '最近消息入库时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of chat_lately
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for chat_message
-- ----------------------------
DROP TABLE IF EXISTS `chat_message`;
CREATE TABLE `chat_message` (
  `id` varchar(32) NOT NULL,
  `message` varchar(255) DEFAULT NULL COMMENT '消息内容',
  `file` varchar(255) DEFAULT NULL COMMENT '文件、也包括图片，根据msgType区分',
  `msg_type` int(2) DEFAULT NULL COMMENT '消息类型 1:文字；3:图片；4：文件',
  `target_type` int(2) DEFAULT NULL COMMENT '目标类型，1、点对点，用户id；2、群聊，代表群租id',
  `sender_id` varchar(32) DEFAULT NULL COMMENT '发送者id',
  `target_id` varchar(32) DEFAULT NULL COMMENT '目标id',
  `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of chat_message
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for chat_relation
-- ----------------------------
DROP TABLE IF EXISTS `chat_relation`;
CREATE TABLE `chat_relation` (
  `id` varchar(32) NOT NULL,
  `owner_id` varchar(32) DEFAULT NULL COMMENT '关联关系的主人id',
  `target_id` varchar(32) DEFAULT NULL COMMENT '被关联用户的id',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `created_time` datetime DEFAULT NULL COMMENT '创建关联的时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `owner-target` (`owner_id`,`target_id`) USING BTREE COMMENT '两个用户的联合索引'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of chat_relation
-- ----------------------------
BEGIN;
INSERT INTO `chat_relation` VALUES ('e8eeb0d984b511ec80320242ac110004', '17', '2', NULL, '2022-02-03 13:55:37');
INSERT INTO `chat_relation` VALUES ('e90f29d984b511ec80320242ac110004', '2', '17', NULL, '2022-02-03 13:55:38');
COMMIT;

-- ----------------------------
-- Table structure for chat_relation_req
-- ----------------------------
DROP TABLE IF EXISTS `chat_relation_req`;
CREATE TABLE `chat_relation_req` (
  `id` varchar(32) NOT NULL,
  `sender_id` varchar(32) DEFAULT NULL COMMENT '请求发送者',
  `target_id` varchar(32) DEFAULT NULL COMMENT '目标用户',
  `created_time` datetime DEFAULT NULL COMMENT '好友请求发送时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `no-repeat` (`sender_id`,`target_id`) USING BTREE COMMENT '三个字段为标识不可重复'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- ----------------------------
-- Records of chat_relation_req
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for oauth_client_details
-- ----------------------------
DROP TABLE IF EXISTS `oauth_client_details`;
CREATE TABLE `oauth_client_details` (
  `client_id` varchar(48) NOT NULL COMMENT '客户端id',
  `resource_ids` varchar(256) DEFAULT NULL COMMENT '资源id',
  `client_secret` varchar(256) DEFAULT NULL COMMENT '客户端访问密钥',
  `scope` varchar(256) DEFAULT NULL COMMENT '访问标识，也可以认为是密码',
  `authorized_grant_types` varchar(256) DEFAULT NULL COMMENT '访问方法类型，4种类型，看文档',
  `web_server_redirect_uri` varchar(256) DEFAULT NULL COMMENT '授权成功后跳转到什么页面，所谓第三方用户访问',
  `authorities` varchar(256) DEFAULT NULL,
  `access_token_validity` int(11) DEFAULT NULL COMMENT 'token存活时间',
  `refresh_token_validity` int(11) DEFAULT NULL COMMENT 'token可以刷新的时间，手动刷新！',
  `additional_information` varchar(4096) DEFAULT NULL,
  `autoapprove` varchar(256) DEFAULT NULL COMMENT '是否自动确认授权，true:自动授权，false:手动授权',
  PRIMARY KEY (`client_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of oauth_client_details
-- ----------------------------
BEGIN;
INSERT INTO `oauth_client_details` VALUES ('c1', 'res1', '$2a$10$HGKpZN3vzXx2UbPXArjnLeDnbUd1q0ft1ttASU7nDaL1tZUzypTPO', 'all', 'authorization_code,password,client_credentials,implicit,,refresh_token', 'http://www.baidu.com', NULL, -1, 259200, NULL, 'false');
COMMIT;

-- ----------------------------
-- Table structure for oauth_code
-- ----------------------------
DROP TABLE IF EXISTS `oauth_code`;
CREATE TABLE `oauth_code` (
  `create_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `code` varchar(255) DEFAULT NULL,
  `authentication` blob
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of oauth_code
-- ----------------------------
BEGIN;
INSERT INTO `oauth_code` VALUES ('2020-02-09 01:54:59', 'YPgkjz', 0xACED0005737200416F72672E737072696E676672616D65776F726B2E73656375726974792E6F61757468322E70726F76696465722E4F417574683241757468656E7469636174696F6EBD400B02166252130200024C000D73746F7265645265717565737474003C4C6F72672F737072696E676672616D65776F726B2F73656375726974792F6F61757468322F70726F76696465722F4F4175746832526571756573743B4C00127573657241757468656E7469636174696F6E7400324C6F72672F737072696E676672616D65776F726B2F73656375726974792F636F72652F41757468656E7469636174696F6E3B787200476F72672E737072696E676672616D65776F726B2E73656375726974792E61757468656E7469636174696F6E2E416273747261637441757468656E7469636174696F6E546F6B656ED3AA287E6E47640E0200035A000D61757468656E746963617465644C000B617574686F7269746965737400164C6A6176612F7574696C2F436F6C6C656374696F6E3B4C000764657461696C737400124C6A6176612F6C616E672F4F626A6563743B787000737200266A6176612E7574696C2E436F6C6C656374696F6E7324556E6D6F6469666961626C654C697374FC0F2531B5EC8E100200014C00046C6973747400104C6A6176612F7574696C2F4C6973743B7872002C6A6176612E7574696C2E436F6C6C656374696F6E7324556E6D6F6469666961626C65436F6C6C656374696F6E19420080CB5EF71E0200014C00016371007E00047870737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000002770400000002737200426F72672E737072696E676672616D65776F726B2E73656375726974792E636F72652E617574686F726974792E53696D706C654772616E746564417574686F7269747900000000000001FE0200014C0004726F6C657400124C6A6176612F6C616E672F537472696E673B787074000E524F4C455FE7AEA1E79086E591987371007E000D740011524F4C455FE699AEE9809AE59198E5B7A57871007E000C707372003A6F72672E737072696E676672616D65776F726B2E73656375726974792E6F61757468322E70726F76696465722E4F41757468325265717565737400000000000000010200075A0008617070726F7665644C000B617574686F72697469657371007E00044C000A657874656E73696F6E7374000F4C6A6176612F7574696C2F4D61703B4C000B726564697265637455726971007E000E4C00077265667265736874003B4C6F72672F737072696E676672616D65776F726B2F73656375726974792F6F61757468322F70726F76696465722F546F6B656E526571756573743B4C000B7265736F7572636549647374000F4C6A6176612F7574696C2F5365743B4C000D726573706F6E7365547970657371007E0016787200386F72672E737072696E676672616D65776F726B2E73656375726974792E6F61757468322E70726F76696465722E426173655265717565737436287A3EA37169BD0200034C0008636C69656E74496471007E000E4C001172657175657374506172616D657465727371007E00144C000573636F706571007E001678707400026331737200256A6176612E7574696C2E436F6C6C656374696F6E7324556E6D6F6469666961626C654D6170F1A5A8FE74F507420200014C00016D71007E00147870737200116A6176612E7574696C2E486173684D61700507DAC1C31660D103000246000A6C6F6164466163746F724900097468726573686F6C6478703F400000000000067708000000080000000474000D726573706F6E73655F74797065740004636F646574000C72656469726563745F757269740014687474703A2F2F7777772E62616964752E636F6D7400057363706F65740003616C6C740009636C69656E745F696471007E001978737200256A6176612E7574696C2E436F6C6C656374696F6E7324556E6D6F6469666961626C65536574801D92D18F9B80550200007871007E0009737200176A6176612E7574696C2E4C696E6B656448617368536574D86CD75A95DD2A1E020000787200116A6176612E7574696C2E48617368536574BA44859596B8B7340300007870770C000000103F40000000000001740003616C6C78017371007E0028770C000000103F40000000000000787371007E001C3F40000000000000770800000010000000007871007E0021707371007E0028770C000000103F4000000000000174000472657331787371007E0028770C000000103F4000000000000171007E001F787372004F6F72672E737072696E676672616D65776F726B2E73656375726974792E61757468656E7469636174696F6E2E557365726E616D6550617373776F726441757468656E7469636174696F6E546F6B656E00000000000001FE0200024C000B63726564656E7469616C7371007E00054C00097072696E636970616C71007E00057871007E0003017371007E00077371007E000B0000000277040000000271007E000F71007E00117871007E0033737200486F72672E737072696E676672616D65776F726B2E73656375726974792E7765622E61757468656E7469636174696F6E2E57656241757468656E7469636174696F6E44657461696C7300000000000001FE0200024C000D72656D6F74654164647265737371007E000E4C000973657373696F6E496471007E000E787074000F303A303A303A303A303A303A303A3174002041394343354132444544443141444433394436423833383931384439453539397073720024636F6D2E7169752E617574686F72697A657365727665722E706F6A6F2E56756555736572354AC4DE0CCEE3750200065A0006656E61626C6549000269645A00066C6F636B65644C000870617373776F726471007E000E4C0005726F6C657371007E00084C0008757365726E616D6571007E000E787001000000010074003C2432612431302448474B705A4E33767A5878325562505841726A6E4C65446E6255643171306674317474415355376E44614C31745A557A797054504F7371007E000B0000000277040000000273720021636F6D2E7169752E617574686F72697A657365727665722E706F6A6F2E526F6C6569D6B51C7BED2FFA0200014C00046E616D6571007E000E7870740009E7AEA1E79086E591987371007E003C74000CE699AEE9809AE59198E5B7A57874000561646D696E);
COMMIT;

-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP TABLE IF EXISTS `sys_role`;
CREATE TABLE `sys_role` (
  `id` varchar(32) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of sys_role
-- ----------------------------
BEGIN;
INSERT INTO `sys_role` VALUES ('1', 'ROLE_ADMIN');
INSERT INTO `sys_role` VALUES ('2', 'ROLE_NORMAL');
COMMIT;

-- ----------------------------
-- Table structure for sys_role_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_role_user`;
CREATE TABLE `sys_role_user` (
  `id` varchar(32) NOT NULL,
  `roleid` varchar(32) DEFAULT NULL,
  `uid` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of sys_role_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_role_user` VALUES ('1', '1', '1');
INSERT INTO `sys_role_user` VALUES ('2', '2', '1');
INSERT INTO `sys_role_user` VALUES ('3', '2', '2');
INSERT INTO `sys_role_user` VALUES ('4', '2', '3');
COMMIT;

-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
  `id` varchar(32) NOT NULL,
  `user_name` varchar(255) NOT NULL COMMENT '用户名，不更改用的',
  `password` varchar(255) DEFAULT NULL,
  `roleid` int(11) DEFAULT NULL,
  `locked` tinyint(2) DEFAULT NULL,
  `enable` tinyint(2) DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像url',
  `self_comment` varchar(255) DEFAULT NULL COMMENT '自我坪价',
  `sex` int(2) DEFAULT NULL COMMENT '性别 1男 2女',
  `show_name` varchar(255) DEFAULT NULL COMMENT '对外暴露的名字',
  `created_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`,`user_name`) USING BTREE,
  KEY `search_key` (`user_name`,`show_name`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;

-- ----------------------------
-- Records of sys_user
-- ----------------------------
BEGIN;
INSERT INTO `sys_user` VALUES ('1', 'admin', '$2a$10$HGKpZN3vzXx2UbPXArjnLeDnbUd1q0ft1ttASU7nDaL1tZUzypTPO', 1, 0, 1, 'https://cdn.uviewui.com/uview/common/logo.png', '邱哥哥是不会告诉你性别的', 2, '我是管理员大哥', '2019-01-08 11:25:05', '2021-04-13 10:35:28');
INSERT INTO `sys_user` VALUES ('17', 'firechildren', '$2a$10$HGKpZN3vzXx2UbPXArjnLeDnbUd1q0ft1ttASU7nDaL1tZUzypTPO', 2, 0, 1, 'https://cdn.uviewui.com/uview/common/logo.png', '我就是专门发布测试用的，我就是专门发布测试用的我就是专门发布测试用的我就是专门发布测试用的', 1, '邱君斌', '2020-02-08 11:25:05', '2021-03-16 12:40:16');
INSERT INTO `sys_user` VALUES ('18', 'wucc', '$2a$10$J8vm5MuaXWmok6YkYv5iaOuJll5U1wMNIRl4K8G1aI2gE0vI/UAYi', 2, 0, 1, 'https://cdn.uviewui.com/uview/common/logo.png', '啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊', 1, 'wcc测试号', '2021-01-08 11:25:05', '2021-03-08 11:25:05');
INSERT INTO `sys_user` VALUES ('2', 'user', '$2a$10$QrvFQFiiatMpnC47i4mbnOHyOyzNl6Rugs6KfTgRw81qu0PTR8oP.', 2, 0, 1, NULL, '别看我性别是女的，其实我是男的', 2, '转用户原来是测试2', '2019-03-08 11:25:05', '2021-04-14 16:54:33');
INSERT INTO `sys_user` VALUES ('3', 'futaoli', '$2a$10$QrvFQFiiatMpnC47i4mbnOHyOyzNl6Rugs6KfTgRw81qu0PTR8oP.', 2, 0, 1, NULL, '李福涛', 2, '李福涛', '2021-12-11 12:28:15', '2021-12-11 12:28:17');
INSERT INTO `sys_user` VALUES ('4', 'yihanfeng', '$2a$10$QrvFQFiiatMpnC47i4mbnOHyOyzNl6Rugs6KfTgRw81qu0PTR8oP.', 2, 0, 1, NULL, '冯亦涵', 1, '冯亦涵', '2021-12-11 12:28:56', '2021-12-11 12:28:59');
INSERT INTO `sys_user` VALUES ('5', 'jinzhaoyang', '$2a$10$QrvFQFiiatMpnC47i4mbnOHyOyzNl6Rugs6KfTgRw81qu0PTR8oP.', 2, 0, 1, NULL, '杨金钊', 1, '杨金钊', '2021-12-11 12:29:42', '2021-12-11 12:29:44');
INSERT INTO `sys_user` VALUES ('6', 'jiahuiye', '$2a$10$QrvFQFiiatMpnC47i4mbnOHyOyzNl6Rugs6KfTgRw81qu0PTR8oP.', 2, 0, 1, NULL, '叶➕惠', 2, '叶➕惠', '2021-12-11 12:30:22', '2021-12-11 12:30:25');
INSERT INTO `sys_user` VALUES ('7', 'jiaweiliang', '$2a$10$QrvFQFiiatMpnC47i4mbnOHyOyzNl6Rugs6KfTgRw81qu0PTR8oP.', 2, 0, 1, NULL, '梁➕伟', 2, '梁➕伟', '2021-12-11 12:59:00', '2021-12-11 12:59:03');
INSERT INTO `sys_user` VALUES ('8', 'linjie', '$2a$10$QrvFQFiiatMpnC47i4mbnOHyOyzNl6Rugs6KfTgRw81qu0PTR8oP.', 2, 0, 1, NULL, 'JJ', 1, 'JJ', '2021-12-11 13:56:00', '2021-12-11 13:56:03');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
